package ui.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fy.fyzf.R;
import com.fy.fyzf.bean.DemanddetailBean;
import com.fy.fyzf.bean.MyRecommendBean;
import com.fy.fyzf.glideUtils.GlideUtils;
import com.mcxtzhang.swipemenulib.SwipeMenuLayout;

import java.io.Serializable;

import ui.activity.HouseDetailActivity;

public class AllDemandAdapter2 extends BaseQuickAdapter<MyRecommendBean.ListBean, BaseViewHolder> {

    private int type;
    private Context mContext;
    public AllDemandAdapter2(Context context) {
        super(R.layout.item_response_info);
        mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MyRecommendBean.ListBean item) {

//        GlideUtils.loadCircleImage(item.getCompanyName(),helper.getView(R.id.iv_head));
        helper.setText(R.id.tv_name, item.getFloorName())
                .setText(R.id.tv_company, item.getHousingArea()+"m²  |  "+item.getAreaName())
                .setText(R.id.tv_time, item.getCreateTime());
        helper.addOnClickListener(R.id.tv_delete);
        SwipeMenuLayout swipeMenuLayout = (SwipeMenuLayout) helper.itemView;
        helper.getView(R.id.ll_item).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, HouseDetailActivity.class);
                intent.putExtra("housingid", item.getHousingId());
                intent.putExtra("logo", item.getUserPortrait());
                intent.putExtra("name", item.getUserName());
                intent.putExtra("type", 4);
                mContext.startActivity(intent);
            }
        });

    }
}
